-- hp_to_immunity
-- created by zhuangsl
-- 生命低于一定百分比时免疫异常状态

return {
    -- 返回的是提升的攻击点数
    apply = function(prop, baseValue)
        return prop[3];
    end,

    trigger = function(who, prop, arg)
        local rate = math.modf(1000 * who:queryAttrib("hp") / who:queryAttrib("max_hp"));

        if (rate < prop[3]) then
            return true;
        end

        return false;
    end,

    record = function(target, prop, path)
        return false;
    end
};